function loadMdEdit(idCanvas) {

	var TxtFont1 = 'bold 32px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TxtFont2 = 'bold 48px  "ＭＳ 明朝", "平成明朝", "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TxtFont3 = 'bold 20px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TxtFont4 = 'bold 14px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TxtFont5 = 'bold 24px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	summonFlg = 0;
	bubbleFlg = 0;
	pgStatus = 0;
	btnFlg = 0;
	useKanji1 = 0;
	useKanji2 = 0;
	useKanji3 = 0;
	userBPNum = 0;
	userBPNum1 = 0;
	userBPNum2 = 0;
	userBPNum3 = 0;
	userAPNum = 0;
	userAPNum1 = 0;
	userAPNum2 = 0;
	userAPNum3 = 0;
	userSelType1 = "";
	userSelType2 = "";
	userSelType3 = "";
	userSelTypeTxt1 = "";
	userSelTypeTxt2 = "";
	userSelTypeTxt3 = "";
	cnt = 0;

	var summonTxt = '';
	var summonedTxt = '';
	var delLabel = '消';

	jc.start(idCanvas, true);

	var hdArray = [ hdTxt01, hdTxt02, hdTxt03, hdTxt04, hdTxt05, hdTxt06, hdTxt07, hdTxt08 ];
	var bpArray = [ kanji01Bp, kanji02Bp, kanji03Bp, kanji04Bp, kanji05Bp, kanji06Bp, kanji07Bp, kanji08Bp ];
	var apArray = [ kanji01Ap, kanji02Ap, kanji03Ap, kanji04Ap, kanji05Ap, kanji06Ap, kanji07Ap, kanji08Ap ];
	var typeArray = [ kanji01Type, kanji02Type, kanji03Type, kanji04Type, kanji05Type, kanji06Type, kanji07Type, kanji08Type ];
	var typeTxtArray = [ kanji01TypeTxt, kanji02TypeTxt, kanji03TypeTxt, kanji04TypeTxt, kanji05TypeTxt, kanji06TypeTxt, kanji07TypeTxt, kanji08TypeTxt ];

	if (userBP != 0) {
		userBPNum = userBP;
	} else {
		for (i = 0; i < 8; i++) {
			if (hdArray[i] == useTxt01 || hdArray[i] == useTxt02 || hdArray[i] == useTxt03) {
				userBPNum = userBPNum + bpArray[i];
				userBP = userBP + bpArray[i];
			}
		}
	}
	if (userAP != 0) {
		userAPNum = userAP;
	} else {
		for (i = 0; i < 8; i++) {
			if (hdArray[i] == useTxt01 || hdArray[i] == useTxt02 || hdArray[i] == useTxt03) {
				userAPNum = userAPNum + apArray[i];
				userAP = userAP + apArray[i];
			}
		}
	}

	jc.text("緑の枠に使いたい漢字を３つ選んで", 145, 15, 'rgb(255,255,255)').font(TxtFont4).align('center');
	jc.text("決定ボタンをクリック！", 145, 35, 'rgb(255,255,255)').font(TxtFont4).align('center');

	// 漢字フォルダ画像の描画
	jc.rect(0, 45, 290, 135, 'rgba(255,156,135,0.5)', 1);
	jc.rect(15, 50, 255, 125, 'rgba(255,255,255,1)', 1);
	// 上段
	jc.rect(25, 60, 53, 48, 'rgba(0,0,0,1)', 0).id("hd01E").layer('L_hd01E');
	jc.rect(85, 60, 53, 48, 'rgba(0,0,0,1)', 0).id("hd02E").layer('L_hd02E');
	jc.rect(145, 60, 53, 48, 'rgba(0,0,0,1)', 0).id("hd03E").layer('L_hd03E');
	jc.rect(205, 60, 53, 48, 'rgba(0,0,0,1)', 0).id("hd04E").layer('L_hd04E');
	jc.text(hdTxt01, 27, 100, 'rgb(0,0,0)').id("hdText01E").font(TxtFont2).opacity(1).layer('L_hd01E');
	jc.text(hdTxt02, 87, 100, 'rgb(0,0,0)').id("hdText02E").font(TxtFont2).opacity(1).layer('L_hd02E');
	jc.text(hdTxt03, 147, 100, 'rgb(0,0,0)').id("hdText03E").font(TxtFont2).opacity(1).layer('L_hd03E');
	jc.text(hdTxt04, 207, 100, 'rgb(0,0,0)').id("hdText04E").font(TxtFont2).opacity(1).layer('L_hd04E');

	// 下段
	jc.rect(25, 117, 53, 48, 'rgba(0,0,0,1)', 0).id("hd05E").layer('L_hd05E');
	jc.rect(85, 117, 53, 48, 'rgba(0,0,0,1)', 0).id("hd06E").layer('L_hd06E');
	jc.rect(145, 117, 53, 48, 'rgba(0,0,0,1)', 0).id("hd07E").layer('L_hd07E');
	jc.rect(205, 117, 53, 48, 'rgba(0,0,0,1)', 0).id("hd08E").layer('L_hd08E');
	jc.text(hdTxt05, 27, 157, 'rgb(0,0,0)').id("hdText05E").font(TxtFont2).opacity(1).layer('L_hd05E');
	jc.text(hdTxt06, 87, 157, 'rgb(0,0,0)').id("hdText06E").font(TxtFont2).opacity(1).layer('L_hd06E');
	jc.text(hdTxt07, 147, 157, 'rgb(0,0,0)').id("hdText07E").font(TxtFont2).opacity(1).layer('L_hd07E');
	jc.text(hdTxt08, 207, 157, 'rgb(0,0,0)').id("hdText08E").font(TxtFont2).opacity(1).layer('L_hd08E');

	jc('#hd01E').click(function() {
		if (jc('#hdText01E').string() != '') {
			if (jc('#useText01E').string() == '') {
				jc('#useText01E').string(jc('#hdText01E').string());
				useKanji1 = 1;
				userBPNum1 = kanji01Bp;
				userAPNum1 = kanji01Ap;
				userSelType1 = kanji01Type;
				userSelTypeTxt1 = kanji01TypeTxt;
				putType(kanji01TypeTxt);
				putKJStatus(userBPNum1,userAPNum1,userSelTypeTxt1,'1');
			} else if (jc('#useText02E').string() == '') {
				jc('#useText02E').string(jc('#hdText01E').string());
				useKanji2 = 1;
				userBPNum2 = kanji01Bp;
				userAPNum2 = kanji01Ap;
				userSelType2 = kanji01Type;
				userSelTypeTxt2 = kanji01TypeTxt;
				putType(kanji01TypeTxt);
				putKJStatus(userBPNum2,userAPNum2,userSelTypeTxt2,'2');
			} else if (jc('#useText03E').string() == '') {
				jc('#useText03E').string(jc('#hdText01E').string());
				useKanji3 = 1;
				userBPNum3 = kanji01Bp;
				userAPNum3 = kanji01Ap;
				userSelType3 = kanji01Type;
				userSelTypeTxt3 = kanji01TypeTxt;
				putType(kanji01TypeTxt);
				putKJStatus(userBPNum3,userAPNum3,userSelTypeTxt3,'3');
			} else {
				return;
			}
			userBPNum = userBPNum + kanji01Bp;
			userAPNum = userAPNum + kanji01Ap;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#hdText01E').string('');
		}
	});

	jc('#hd02E').click(function() {
		if (jc('#hdText02E').string() != '') {
			if (jc('#useText01E').string() == '') {
				jc('#useText01E').string(jc('#hdText02E').string());
				useKanji1 = 2;
				userBPNum1 = kanji02Bp;
				userAPNum1 = kanji02Ap;
				userSelType1 = kanji02Type;
				userSelTypeTxt1 = kanji02TypeTxt;
				putType(kanji02TypeTxt);
				putKJStatus(userBPNum1,userAPNum1,userSelTypeTxt1,'1');
			} else if (jc('#useText02E').string() == '') {
				jc('#useText02E').string(jc('#hdText02E').string());
				useKanji2 = 2;
				userBPNum2 = kanji02Bp;
				userAPNum2 = kanji02Ap;
				userSelType2 = kanji02Type;
				userSelTypeTxt2 = kanji02TypeTxt;
				putType(kanji02TypeTxt);
				putKJStatus(userBPNum2,userAPNum2,userSelTypeTxt2,'2');
			} else if (jc('#useText03E').string() == '') {
				jc('#useText03E').string(jc('#hdText02E').string());
				useKanji3 = 2;
				userBPNum3 = kanji02Bp;
				userAPNum3 = kanji02Ap;
				userSelType3 = kanji02Type;
				userSelTypeTxt3 = kanji02TypeTxt;
				putType(kanji02TypeTxt);
				putKJStatus(userBPNum3,userAPNum3,userSelTypeTxt3,'3');
			} else {
				return;
			}
			userBPNum = userBPNum + kanji02Bp;
			userAPNum = userAPNum + kanji02Ap;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#hdText02E').string('');
		}
	});

	jc('#hd03E').click(function() {
		if (jc('#hdText03E').string() != '') {
			if (jc('#useText01E').string() == '') {
				jc('#useText01E').string(jc('#hdText03E').string());
				useKanji1 = 3;
				userBPNum1 = kanji03Bp;
				userAPNum1 = kanji03Ap;
				userSelType1 = kanji03Type;
				userSelTypeTxt1 = kanji03TypeTxt;
				putType(kanji03TypeTxt);
				putKJStatus(userBPNum1,userAPNum1,userSelTypeTxt1,'1');
			} else if (jc('#useText02E').string() == '') {
				jc('#useText02E').string(jc('#hdText03E').string());
				useKanji2 = 3;
				userBPNum2 = kanji03Bp;
				userAPNum2 = kanji03Ap;
				userSelType2 = kanji03Type;
				userSelTypeTxt2 = kanji03TypeTxt;
				putType(kanji03TypeTxt);
				putKJStatus(userBPNum2,userAPNum2,userSelTypeTxt2,'2');
			} else if (jc('#useText03E').string() == '') {
				jc('#useText03E').string(jc('#hdText03E').string());
				useKanji3 = 3;
				userBPNum3 = kanji03Bp;
				userAPNum3 = kanji03Ap;
				userSelType3 = kanji03Type;
				userSelTypeTxt3 = kanji03TypeTxt;
				putType(kanji03TypeTxt);
				putKJStatus(userBPNum3,userAPNum3,userSelTypeTxt3,'3');
			} else {
				return;
			}
			userBPNum = userBPNum + kanji03Bp;
			userAPNum = userAPNum + kanji03Ap;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#hdText03E').string('');
		}
	});

	jc('#hd04E').click(function() {
		if (jc('#hdText04E').string() != '') {
			if (jc('#useText01E').string() == '') {
				jc('#useText01E').string(jc('#hdText04E').string());
				useKanji1 = 4;
				userBPNum1 = kanji04Bp;
				userAPNum1 = kanji04Ap;
				userSelType1 = kanji04Type;
				userSelTypeTxt1 = kanji04TypeTxt;
				putType(kanji04TypeTxt);
				putKJStatus(userBPNum1,userAPNum1,userSelTypeTxt1,'1');
			} else if (jc('#useText02E').string() == '') {
				jc('#useText02E').string(jc('#hdText04E').string());
				useKanji2 = 4;
				userBPNum2 = kanji04Bp;
				userAPNum2 = kanji04Ap;
				userSelType2 = kanji04Type;
				userSelTypeTxt2 = kanji04TypeTxt;
				putType(kanji04TypeTxt);
				putKJStatus(userBPNum2,userAPNum2,userSelTypeTxt2,'2');
			} else if (jc('#useText03E').string() == '') {
				jc('#useText03E').string(jc('#hdText04E').string());
				useKanji3 = 4;
				userBPNum3 = kanji04Bp;
				userAPNum3 = kanji04Ap;
				userSelType3 = kanji04Type;
				userSelTypeTxt3 = kanji04TypeTxt;
				putType(kanji04TypeTxt);
				putKJStatus(userBPNum3,userAPNum3,userSelTypeTxt3,'3');
			} else {
				return;
			}
			userBPNum = userBPNum + kanji04Bp;
			userAPNum = userAPNum + kanji04Ap;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#hdText04E').string('');
		}
	});

	jc('#hd05E').click(function() {
		if (jc('#hdText05E').string() != '') {
			if (jc('#useText01E').string() == '') {
				jc('#useText01E').string(jc('#hdText05E').string());
				useKanji1 = 5;
				userBPNum1 = kanji05Bp;
				userAPNum1 = kanji05Ap;
				userSelType1 = kanji05Type;
				userSelTypeTxt1 = kanji05TypeTxt;
				putType(kanji05TypeTxt);
				putKJStatus(userBPNum1,userAPNum1,userSelTypeTxt1,'1');
			} else if (jc('#useText02E').string() == '') {
				jc('#useText02E').string(jc('#hdText05E').string());
				useKanji2 = 5;
				userBPNum2 = kanji05Bp;
				userAPNum2 = kanji05Ap;
				userSelType2 = kanji05Type;
				userSelTypeTxt2 = kanji05TypeTxt;
				putType(kanji05TypeTxt);
				putKJStatus(userBPNum2,userAPNum2,userSelTypeTxt2,'2');
			} else if (jc('#useText03E').string() == '') {
				jc('#useText03E').string(jc('#hdText05E').string());
				useKanji3 = 5;
				userBPNum3 = kanji05Bp;
				userAPNum3 = kanji05Ap;
				userSelType3 = kanji05Type;
				userSelTypeTxt3 = kanji05TypeTxt;
				putType(kanji05TypeTxt);
				putKJStatus(userBPNum3,userAPNum3,userSelTypeTxt3,'3');
			} else {
				return;
			}
			userBPNum = userBPNum + kanji05Bp;
			userAPNum = userAPNum + kanji05Ap;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#hdText05E').string('');
		}
	});

	jc('#hd06E').click(function() {
		if (jc('#hdText06E').string() != '') {
			if (jc('#useText01E').string() == '') {
				jc('#useText01E').string(jc('#hdText06E').string());
				useKanji1 = 6;
				userBPNum1 = kanji06Bp;
				userAPNum1 = kanji06Ap;
				userSelType1 = kanji06Type;
				userSelTypeTxt1 = kanji06TypeTxt;
				putType(kanji06TypeTxt);
				putKJStatus(userBPNum1,userAPNum1,userSelTypeTxt1,'1');
			} else if (jc('#useText02E').string() == '') {
				jc('#useText02E').string(jc('#hdText06E').string());
				useKanji2 = 6;
				userBPNum2 = kanji06Bp;
				userAPNum2 = kanji06Ap;
				userSelType2 = kanji06Type;
				userSelTypeTxt2 = kanji06TypeTxt;
				putType(kanji06TypeTxt);
				putKJStatus(userBPNum2,userAPNum2,userSelTypeTxt2,'2');
			} else if (jc('#useText03E').string() == '') {
				jc('#useText03E').string(jc('#hdText06E').string());
				useKanji3 = 6;
				userBPNum3 = kanji06Bp;
				userAPNum3 = kanji06Ap;
				userSelType3 = kanji06Type;
				userSelTypeTxt3 = kanji06TypeTxt;
				putType(kanji06TypeTxt);
				putKJStatus(userBPNum3,userAPNum3,userSelTypeTxt3,'3');
			} else {
				return;
			}
			userBPNum = userBPNum + kanji06Bp;
			userAPNum = userAPNum + kanji06Ap;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#hdText06E').string('');
		}
	});

	jc('#hd07E').click(function() {
		if (jc('#hdText07E').string() != '') {
			if (jc('#useText01E').string() == '') {
				jc('#useText01E').string(jc('#hdText07E').string());
				useKanji1 = 7;
				userBPNum1 = kanji07Bp;
				userAPNum1 = kanji07Ap;
				userSelType1 = kanji07Type;
				userSelTypeTxt1 = kanji07TypeTxt;
				putType(kanji07TypeTxt);
				putKJStatus(userBPNum1,userAPNum1,userSelTypeTxt1,'1');
			} else if (jc('#useText02E').string() == '') {
				jc('#useText02E').string(jc('#hdText07E').string());
				useKanji2 = 7;
				userBPNum2 = kanji07Bp;
				userAPNum2 = kanji07Ap;
				userSelType2 = kanji07Type;
				userSelTypeTxt2 = kanji07TypeTxt;
				putType(kanji07TypeTxt);
				putKJStatus(userBPNum2,userAPNum2,userSelTypeTxt2,'2');
			} else if (jc('#useText03E').string() == '') {
				jc('#useText03E').string(jc('#hdText07E').string());
				useKanji3 = 7;
				userBPNum3 = kanji07Bp;
				userAPNum3 = kanji07Ap;
				userSelType3 = kanji07Type;
				userSelTypeTxt3 = kanji07TypeTxt;
				putType(kanji07TypeTxt);
				putKJStatus(userBPNum3,userAPNum3,userSelTypeTxt3,'3');
			} else {
				return;
			}
			userBPNum = userBPNum + kanji07Bp;
			userAPNum = userAPNum + kanji07Ap;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#hdText07E').string('');
		}
	});

	jc('#hd08E').click(function() {
		if (jc('#hdText08E').string() != '') {
			if (jc('#useText01E').string() == '') {
				jc('#useText01E').string(jc('#hdText08E').string());
				useKanji1 = 8;
				userBPNum1 = kanji08Bp;
				userAPNum1 = kanji08Ap;
				userSelType1 = kanji08Type;
				userSelTypeTxt1 = kanji08TypeTxt;
				putType(kanji08TypeTxt);
				putKJStatus(userBPNum1,userAPNum1,userSelTypeTxt1,'1');
			} else if (jc('#useText02E').string() == '') {
				jc('#useText02E').string(jc('#hdText08E').string());
				useKanji2 = 8;
				userBPNum2 = kanji08Bp;
				userAPNum2 = kanji08Ap;
				userSelType2 = kanji08Type;
				userSelTypeTxt2 = kanji08TypeTxt;
				putType(kanji08TypeTxt);
				putKJStatus(userBPNum2,userAPNum2,userSelTypeTxt2,'2');
			} else if (jc('#useText03E').string() == '') {
				jc('#useText03E').string(jc('#hdText08E').string());
				useKanji3 = 8;
				userBPNum3 = kanji08Bp;
				userAPNum3 = kanji08Ap;
				userSelType3 = kanji08Type;
				userSelTypeTxt3 = kanji08TypeTxt;
				putType(kanji08TypeTxt);
				putKJStatus(userBPNum3,userAPNum3,userSelTypeTxt3,'3');
			} else {
				return;
			}
			userBPNum = userBPNum + kanji08Bp;
			userAPNum = userAPNum + kanji08Ap;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#hdText08E').string('');
		}
	});

	for (i = 0; i < 8; i++) {
		if (hdArray[i] == useTxt01) {
			jc('#hdText0' + (i + 1) + 'E').string('');
			useKanji1 = i + 1;
			userBPNum1 = bpArray[i];
			userAPNum1 = apArray[i];
			userSelType1 = typeArray[i];
			userSelTypeTxt1 = typeTxtArray[i];
		} else if (hdArray[i] == useTxt02) {
			jc('#hdText0' + (i + 1) + 'E').string('');
			useKanji2 = i + 1;
			userBPNum2 = bpArray[i];
			userAPNum2 = apArray[i];
			userSelType2 = typeArray[i];
			userSelTypeTxt2 = typeTxtArray[i];
		} else if (hdArray[i] == useTxt03) {
			jc('#hdText0' + (i + 1) + 'E').string('');
			useKanji3 = i + 1;
			userBPNum3 = bpArray[i];
			userAPNum3 = apArray[i];
			userSelType3 = typeArray[i];
			userSelTypeTxt3 = typeTxtArray[i];
		}
	}

	// 選択枠１
	jc.rect(21, 185, 60, 60, 'rgba(51,255,0,1)', 1).click(function() {
		if (jc('#useText01E').string() != '') {
			jc('#hdText0' + useKanji1 + 'E').string(jc('#useText01E').string());
			jc('#useText01E').string('');
			userBPNum = userBPNum - userBPNum1;
			userAPNum = userAPNum - userAPNum1;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#K1BpText').string('');
			jc('#K1ApText').string('');
			jc('#K1TypeText').string('');
			removeType(userSelTypeTxt1);
			userBPNum1 = 0;
			userAPNum1 = 0;
			useKanji1 = 0;
			userSelTypeTxt1 = '';
		}
	});
	// 選択枠２
	jc.rect(110, 185, 60, 60, 'rgba(51,255,0,1)', 1).click(function() {
		if (jc('#useText02E').string() != '') {
			jc('#hdText0' + useKanji2 + 'E').string(jc('#useText02E').string());
			jc('#useText02E').string('');
			userBPNum = userBPNum - userBPNum2;
			userAPNum = userAPNum - userAPNum2;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#K2BpText').string('');
			jc('#K2ApText').string('');
			jc('#K2TypeText').string('');
			removeType(userSelTypeTxt2);
			userBPNum2 = 0;
			userAPNum2 = 0;
			useKanji2 = 0;
			userSelTypeTxt2 = '';
		}
	});
	// 選択枠３
	jc.rect(201, 185, 60, 60, 'rgba(51,255,0,1)', 1).click(function() {
		if (jc('#useText03E').string() != '') {
			jc('#hdText0' + useKanji3 + 'E').string(jc('#useText03E').string());
			jc('#useText03E').string('');
			userBPNum = userBPNum - userBPNum3;
			userAPNum = userAPNum - userAPNum3;
			jc('#bpTextE').string(userBPNum);
			jc('#apTextE').string(userAPNum);
			jc('#K3BpText').string('');
			jc('#K3ApText').string('');
			jc('#K3TypeText').string('');
			removeType(userSelTypeTxt3);
			userBPNum3 = 0;
			userAPNum3 = 0;
			useKanji3 = 0;
			userSelTypeTxt3 = '';
		}
	});

	jc.text('体：', 18, 260, 'rgb(255,255,255)').font(TxtFont4).layer('L_use01');
	jc.text('攻：', 18, 277, 'rgb(255,255,255)').font(TxtFont4).layer('L_use01');
	jc.text("属：", 18, 295, 'rgb(255,255,255)').font(TxtFont4).layer('L_use01');
	jc.text('体：', 108, 260, 'rgb(255,255,255)').font(TxtFont4).layer('L_use02');
	jc.text('攻：', 108, 277, 'rgb(255,255,255)').font(TxtFont4).layer('L_use02');
	jc.text("属：", 108, 295, 'rgb(255,255,255)').font(TxtFont4).layer('L_use02');
	jc.text('体：', 198, 260, 'rgb(255,255,255)').font(TxtFont4).layer('L_use03');
	jc.text('攻：', 198, 277, 'rgb(255,255,255)').font(TxtFont4).layer('L_use03');
	jc.text("属：", 198, 295, 'rgb(255,255,255)').font(TxtFont4).layer('L_use03');

	jc.text('9999', 48, 260, 'rgb(255,255,255)').id("K1BpText").font(TxtFont4).layer('L_use01');
	jc.text('9999', 48, 277, 'rgb(255,255,255)').id("K1ApText").font(TxtFont4).layer('L_use01');
	jc.text("木", 48, 295, 'rgb(255,255,255)').id("K1TypeText").font(TxtFont4).layer('L_use01');
	jc.text('9999', 138, 260, 'rgb(255,255,255)').id("K2BpText").font(TxtFont4).layer('L_use02');
	jc.text('9999', 138, 277, 'rgb(255,255,255)').id("K2ApText").font(TxtFont4).layer('L_use02');
	jc.text("木", 138, 295, 'rgb(255,255,255)').id("K2TypeText").font(TxtFont4).layer('L_use02');
	jc.text('9999', 228, 260, 'rgb(255,255,255)').id("K3BpText").font(TxtFont4).layer('L_use03');
	jc.text('9999', 228, 277, 'rgb(255,255,255)').id("K3ApText").font(TxtFont4).layer('L_use03');
	jc.text("木", 228, 295, 'rgb(255,255,255)').id("K3TypeText").font(TxtFont4).layer('L_use03');

	if (useTxt01 != null) {
		jc.text(useTxt01, 25, 230, 'rgb(0,0,0)').id("useText01E").font(TxtFont2).opacity(1).layer('L_use01');
		jc('#K1BpText').string(userBPNum1);
		jc('#K1ApText').string(userAPNum1);
		jc('#K1TypeText').string(userSelTypeTxt1);
	} else {
		jc.text("", 25, 230, 'rgb(0,0,0)').id("useText01E").font(TxtFont2).opacity(1).layer('L_use01');
		jc('#K1BpText').string('');
		jc('#K1ApText').string('');
		jc('#K1TypeText').string('');
	}
	if (useTxt02 != null) {
		jc.text(useTxt02, 114, 230, 'rgb(0,0,0)').id("useText02E").font(TxtFont2).opacity(1).layer('L_use02');
		jc('#K2BpText').string(userBPNum2);
		jc('#K2ApText').string(userAPNum2);
		jc('#K2TypeText').string(userSelTypeTxt2);
	} else {
		jc.text("", 114, 230, 'rgb(0,0,0)').id("useText02E").font(TxtFont2).opacity(1).layer('L_use02');
		jc('#K2BpText').string('');
		jc('#K2ApText').string('');
		jc('#K2TypeText').string('');
	}
	if (useTxt03 != null) {
		jc.text(useTxt03, 205, 230, 'rgb(0,0,0)').id("useText03E").font(TxtFont2).opacity(1).layer('L_use03');
		jc('#K3BpText').string(userBPNum3);
		jc('#K3ApText').string(userAPNum3);
		jc('#K3TypeText').string(userSelTypeTxt3);
	} else {
		jc.text("", 205, 230, 'rgb(0,0,0)').id("useText03E").font(TxtFont2).opacity(1).layer('L_use03');
		jc('#K3BpText').string('');
		jc('#K3ApText').string('');
		jc('#K3TypeText').string('');
	}

	jc.rect(0, 305, 290, 125, 'rgba(180,180,180)', 1);

	jc.text("　総体力：", 10, 325, 'rgb(0,0,0)').font(TxtFont3).opacity(1);
	jc.text("総攻撃力：", 10, 350, 'rgb(0,0,0)').font(TxtFont3).opacity(1);
	jc.text("得意属性：", 10, 375, 'rgb(0,0,0)').font(TxtFont3).opacity(1);
	jc.text(userBP, 115, 326, 'rgb(255,0,0)').id("bpTextE").font(TxtFont3).opacity(1);
	jc.text(userAP, 115, 351, 'rgb(255,0,0)').id("apTextE").font(TxtFont3).opacity(1);
	jc.text("", 115, 375, 'rgb(255,0,0)').id("typeText1").font(TxtFont3).opacity(1);
	jc.text("", 175, 375, 'rgb(255,0,0)').id("typeText2").font(TxtFont3).opacity(1);
	jc.text("", 235, 375, 'rgb(255,0,0)').id("typeText3").font(TxtFont3).opacity(1);
	jc.text("", 137, 375, 'rgb(255,0,0)').id("typeX1").font(TxtFont4).opacity(1);
	jc.text("", 197, 375, 'rgb(255,0,0)').id("typeX2").font(TxtFont4).opacity(1);
	jc.text("", 257, 375, 'rgb(255,0,0)').id("typeX3").font(TxtFont4).opacity(1);

	if (useTypeTxt01 != null) {
		putType(useTypeTxt01);
	}
	if (useTypeTxt02 != null) {
		putType(useTypeTxt02);
	}
	if (useTypeTxt03 != null) {
		putType(useTypeTxt03);
	}


	jc.rect(10, 385, 120, 38, 'rgba(256,153,0)', 1).id("Btn_OK");

	jc('#Btn_OK').shadow({
		x : 5,
		y : 5,
		color : '#000000'
	});

	jc.text("決　定", 70, 417, 'rgb(0,0,0)').font(TxtFont1).align('center').mouseover(function() {
		this.color('#ffff00');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	});

	jc('#Btn_OK').click(function() {
		if (btnFlg == 0) {
			btnFlg = 1;
			useTxt01 = jc('#useText01E').string();
			useTxt02 = jc('#useText02E').string();
			useTxt03 = jc('#useText03E').string();
			userBP = jc('#bpTextE').string();
			userAP = jc('#apTextE').string();
			var ED_1d = new Date();
			$.getJSON('../main/mdSummonCommit' + '?_=' + ED_1d.getMilliseconds(), {
				userId : userId,
				usingKanji01 : useTxt01,
				usingKanji02 : useTxt02,
				usingKanji03 : useTxt03,
				usingKanjiType01 : userSelType1,
				usingKanjiType02 : userSelType2,
				usingKanjiType03 : userSelType3,
				usingKanjiTypeText01 : userSelTypeTxt1,
				usingKanjiTypeText02 : userSelTypeTxt2,
				usingKanjiTypeText03 : userSelTypeTxt3,
				userBp : userBP,
				userAp : userAP
			}, callbackSummonCommit, "json");
			cnt = 0;
			jc('#pgRectE').visible(true);
			jc('#pgLabelE').visible(true);
			jc('#pgRectE').opacity(1);
			jc('#pgLabelE').opacity(0);
			jc('#pgLabelE').string("登録中…");
			interval_E3 = setInterval(startProgress, 500);
		}
	});

	jc.rect(150, 385, 120, 38, 'rgba(256,153,0)', 1).id("Btn_Return");

	jc('#Btn_Return').shadow({
		x : 5,
		y : 5,
		color : '#000000'
	});

	jc.text("戻　る", 210, 417, 'rgb(0,0,0)').font(TxtFont1).align('center').mouseover(function() {
		this.color('#ffff00');
	}).mouseout(function() {
		this.color('rgb(0,0,0)');
	}).click(function() {
		jc.canvas(idCanvas).clear();
		loadMdMenu(idCanvas);
	});

	jc.rect(0, 155, 290, 80, 'rgba(0,255,0)', 1).id("pgRectE").layer('L_PG').opacity(0);
	jc.text("登録中…", 40, 210, 'rgb(0,0,0)').id("pgLabelE").layer('L_PG').font(TxtFont2).opacity(0);
	jc('#pgRectE').visible(false);
	jc('#pgLabelE').visible(false);

	if (firstLogin == '2') {
		// 詳細パネル描画
		jc.rect(0, 155, 290, 150, 'rgba(0,255,0)', 1).id('ED_DISP').layer('L_ED');
		jc.text("上の枠から使う漢字を", 140, 210, 'rgb(0,0,0)').id("ED_dt1").font(TxtFont5).align('center').opacity(1).layer('L_ED');
		jc.text("３つ選んだら、最後に", 140, 240, 'rgb(0,0,0)').id("ED_dt2").font(TxtFont5).align('center').opacity(1).layer('L_ED');
		jc.text("決定ボタンを押してね", 140, 270, 'rgb(0,0,0)').id("ED_dt3").align('center').font(TxtFont5).opacity(1).layer('L_ED');

		jc.layer('L_ED').objects().click(function() {
			jc.layer('L_ED').objects().opacity(0);
		});
	}

	jc.start(idCanvas, true);

	if (firstLogin == '2') {
		setTimeout(EdtHideDisp, 3000 );
	}

}
function EdtHideDisp() {
	jc.layer('L_ED').objects().fadeOut(1000);
}

function startProgress() {
	cnt++;
	jc('#pgLabelE').fadeIn(500, function() {
		this.fadeOut(500);
	});
	if (cnt > 3) {
		if (pgStatus == 1) {
			btnFlg = 0;
			pgStatus = 0;
			clearInterval(interval_E3);
			jc('#pgLabelE').string("登録成功");
			jc('#pgLabelE').opacity(0);
			jc('#pgLabelE').fadeIn(500, function() {
				jc('#pgRectE').visible(false);
				jc('#pgLabelE').visible(false);
			});
			if (firstLogin == '2') {
				firstLogin = '3';
			}
		} else if (pgStatus == 2) {
			jc('#pgLabelE').string("登録失敗");
			jc('#pgRectE').opacity(1);
			jc('#pgLabelE').opacity(1);
			btnFlg = 0;
			pgStatus = 0;
			clearInterval(interval_E3);
		}
	}
}

function callbackSummonCommit(result) {
	if (result.userId == '') {
		pgStatus = 2;
	} else {
		pgStatus = 1;
	}
}

function putKJStatus(bp,ap,type,num) {
	jc('#K' + num + 'BpText').string(bp);
	jc('#K' + num + 'ApText').string(ap);
	jc('#K' + num + 'TypeText').string(type);
}

function putType(typeTxt) {
	if (jc('#typeText1').string() == '') {
		jc('#typeText1').string(typeTxt);
	} else {
		if (jc('#typeText1').string() == typeTxt) {
			if (jc('#typeX1').string() == '') {
				jc('#typeX1').string('x2');
			} else {
				jc('#typeX1').string('x3');
			}
		} else {
			if (jc('#typeText2').string() == '') {
				jc('#typeText2').string(typeTxt);
			} else {
				if (jc('#typeText2').string() == typeTxt) {
					if (jc('#typeX2').string() == '') {
						jc('#typeX2').string('x2');
					}
				} else {
					if (jc('#typeText3').string() == '') {
						jc('#typeText3').string(typeTxt);
					}
				}
			}
		}
	}
}
function removeType(typeTxt) {
	if (jc('#typeText3').string() == typeTxt) {
		jc('#typeText3').string('');
	} else {
		if (jc('#typeText2').string() == typeTxt) {
			if (jc('#typeX2').string() == 'x2') {
				jc('#typeX2').string('');
			} else {
				jc('#typeText2').string('');
				if (jc('#typeText3').string() != '') {
					jc('#typeText2').string(jc('#typeText3').string());
					jc('#typeText3').string('');
				}
			}
		} else {
			if (jc('#typeX1').string() == 'x3') {
				jc('#typeX1').string('x2');
			} else if (jc('#typeX1').string() == 'x2') {
				jc('#typeX1').string('');
			} else {
				jc('#typeText1').string('');
				if (jc('#typeText2').string() != '') {
					jc('#typeText1').string(jc('#typeText2').string());
					jc('#typeX1').string(jc('#typeX2').string());
					jc('#typeText2').string('');
					jc('#typeX2').string('');
				}
				if (jc('#typeText3').string() != '') {
					jc('#typeText2').string(jc('#typeText3').string());
					jc('#typeText3').string('');
				}
			}
		}
	}
}
